package cn.im.system;

import com.sun.xml.internal.bind.v2.model.core.ID;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/**
 * 从指定配置文件中读取系统参数
 */
@Configuration
@PropertySource(value = "classpath:SystemParams.properties", encoding = "utf-8")
public class consts {


    /**
     * 定制JSON返回报文模式
     * String.format(SystemParams.PATTERN_JSON_RESULT,0,"ok",JsonUtils.obj2json(imSendMsg));
     */
    public static final String PATTERN_JSON_RESULT="{\"code\":%d,\"msg\":\"%s\",\"data\":\"%s\"}";


    /**
     * 企业id
     */
    public static String CORP_ID;

    /**
     * token获取接口地址
     */
    public static String URL_TOKEN;


    @Value("${CORP_ID}")
    public  void setCorpid(String corpid) {
        CORP_ID = corpid;
    }

    @Value("${URL_TOKEN}")
    public  void setUrlToken(String urlToken){
        URL_TOKEN=urlToken;
    }

}
